#ifndef __OamMessageProtocol_h__INCLUDED__
#define __OamMessageProtocol_h__INCLUDED__

#include "TlvMessage.h"

#include <vector>
#include <map>
#include <new>
#include <string>

enum SyncStaeCode
{
    NOT_START,
    INIT_SYNCED_FAILED,
    INIT_SYNCED,
    CNM_FAILED,
    CNM_SYNCED,
    OUT_OF_SYNC,
    GPS_NOT_SYNC,
    GPS_SYNC,
    SERIALPORT_INIT_FAILED,
    GPS_LOCK_FAILED,
    NO_GPS_AND_NEIGHBOURE,
    GPS_INITIALIZING,
    GPS_LOCKED
};

class OamMessageProtocol_Signal
{
public:
    enum SignalType
    {
        INVALID = 0,
        SYSTEM_TIME = 1,
        SYSTEM_TIME_RSP = 2,
        TX_POWER_ATT = 3,
        TX_POWER_ATT_RSP = 4,
        SOFTWARE_INFO_REQ = 5,
        SOFTWARE_INFO_REPORT = 6,
        SOFTWARE_UPGRADE = 7,
        SOFTWARE_UPGRADE_RSP = 8,
        SOFTWARE_UPGRADE_REPORT = 9,
        SYSTEM_STATUS_REQ = 10,
        SYSTEM_STATUS_REPORT = 11,
        EQUIP_ASSETS_REQ = 12,
        EQUIP_ASSETS_REPORT = 13,
        EQUIP_RESET = 14,
        EQUIP_RESET_RSP = 15,
        EQUIP_RESET_ACCI = 16,
        SYNC_MODE = 17,
        SYNC_MODE_RSP = 18,
        SYNC_STATUS_REQ = 19,
        SYNC_STATUS_REPORT = 20,
        GPS_INFO_REQ = 21,
        GPS_INFO_REPORT = 22,
        PA_SETTING = 23,
        PA_SETTING_RSP = 24,
        PA_STATUS_REQ = 25,
        PA_STATUS_RSP = 26,
        ALARM_RPT = 27,
        INIT_CONFIG = 28,
        INIT_CFG_COMP = 29,
        RX_LEV_MIN_CONFIG = 30,
        RX_LEV_MIN_CFG_RSP = 31,
        LOCATION_MODE_SETTING = 32,
        LOCATION_MODE_SETTING_RSP = 33,
        I2C_TYPE_SETTING = 34,
        I2C_TYPE_SETTING_RSP = 35,
        I2C_INFO_GET = 36,
        I2C_INFO = 37,
        I2C_INFO_WRITE = 38,
        I2C_INFO_WRITE_RSP = 39,
        NMM_DELAY_REPORT_MSG = 40,
        TX_POWER_STD_CFG = 41,
        TX_POWER_STD_CFG_RSP = 42,
        TX_POWER_STD_GET = 43,
        TX_POWER_STD_GET_RSP = 44,
        TX_POWER_DBM_STD_GET = 45,
        TX_POWER_DBM_STD_GET_RSP = 46,
        TX_POWER_DBM_CONFIG = 47,
        TX_POWER_DBM_CONFIG_RSP = 48,
        UEID_FILTER_CFG = 49,
        UEID_FILTER_CFG_RSP = 50,
        SCAN_MODE = 51,
        SCAN_MODE_RSP = 52,
        UL_ARFCN_CFG = 53,
        UL_ARFCN_CFG_RSP = 54,
        RUN_TIME_PARA_CFG = 55,
        RUN_TIME_PARA_CFG_CFG = 56,
        INTERFERENCE_ENABLE = 57,
        MAX_SIGNAL
    };

    enum AttributeTypes
    {
        TAG_SIGNAL_TYPE = 0,            // uint8_t
        TAG_SEQ_NUMBER = 1,
        TAG_RETURN_CODE = 2,
        TAG_UCT_TIME = 3,        // uint8_t        
        TAG_TX_POWER = 4,
        TAG_EQUIP_RESET_CODE = 5,
        TAG_VERSION_STR = 6,
        TAG_SCP_ADDR = 7,
        TAG_FTP_PORT = 8,       // abandon
        TAG_USER_NAME = 9,
        TAG_PASSWORD = 10,
        TAG_STATUS_CODE = 11,
        TAG_STATUS_STRING = 12,
        TAG_MD5_VALUE = 13,
        TAG_SYNC_MODE_CODE = 14,
        TAG_SYNC_STATUS_TYPE = 15,
        TAG_SYNC_STATUS_CODE = 16,
        TAG_GPS_STATUS_CODE = 17,
        TAG_RX_POWER = 18, 
        TAG_PA_OP_CODE = 19,
        TAG_PA_ATT = 20,
        TAG_PA_GET_STATE_TARGET_CODE = 21,
        TAG_PA_TEMP = 22,
        TAG_PA_SWR = 23,
        TAG_PA_POWER = 24,
        TAG_ALARM_OP_CODE = 25,
        TAG_ALARM_CODE = 26,
        TAG_BAND_WIDTH = 27,
        TAG_UPGRADE_FILE_NAME = 28,
        TAG_RX_LEV_MIN = 29,
        TAG_RX_LEV_MIN_OFFSET = 30,
        TAG_CPU_TEMP = 31,
        TAG_CPU_USAGE = 32,
        TAG_MEM_USAGE = 33,
        TAG_BOARD_TEMP = 34,
        TAG_USE_FTP_MODE = 35,
        TAG_LOCATION_MODE_ENABLE = 36,
        TAG_IMSI_LIST = 37,
        TAG_SYNC_ARFCN = 38,
        TAG_SYNC_PCI = 39,
        TAG_SYNC_RSSI = 40,
        TAG_SYNC_TAC = 41,
        TAG_I2C_TYPE = 42,
        TAG_I2C_ADDR = 43,
        TAG_I2C_CONTENT = 44,
        TAG_I2C_INFO_LEN = 45,
        TAG_GPS_TIME_DELAY = 46,
        TAG_IS_SAVE_FS = 47,
        TAG_LONGTITUDE = 48,
        TAG_LATITUDE = 49,
        TAG_WORKING_BAND = 50,
        TAG_PHY_VER = 51,
        TAG_KERNEL_VER = 52,
        TAG_IMSI = 53,
        TAG_DELAY = 54,
        TAG_SINR = 55,
        TAG_HW_VER = 56,
        TAG_TX_POWER_STD = 57,
        TAG_TX_POWER_DBM = 58,
        TAG_UEID_FILTER_SWITCH = 59,
        TAG_UEID_FILTER_TIMER = 60,
        TAG_RSRP = 70,
        TAG_UL_EARFCN = 71,
        TAG_DL_ARFCN_LIST = 72,
        TAG_SCAN_PERIOD = 73,
        TAG_WORKING_MODE = 74,
        TAG_IS_RAN_SHARE = 75,
        TAG_NAS_CAUSE_OPERATOR_TYPE = 76,
        TAG_NAS_REJECT_CAUSE = 77,
        TAG_NUM_OF_FAILURE_PARA = 78,
        TAG_FAILURE_PAPA_LIST = 79,
        TAG_ENABLE = 80
    };
    
    static const TlvMessage::Protocol_t TLV_PROTOCOL_NUMBER = 2;

    OamMessageProtocol_Signal(TlvMessage& message);
    virtual ~OamMessageProtocol_Signal();
    virtual TlvMessage::Protocol_t getProtocolType() const;
    virtual TlvMessage::Signal_t   getSignalType() const;
    virtual void getMsgBuffer(uint8_t*& msgBuffer, uint32_t& msgLength);
    TlvMessage& getMessage();

    void packSeqNum(uint32_t seqNum);
    bool unpackSeqNum(uint32_t& seqNum);

protected:
    OamMessageProtocol_Signal(const TlvMessage::Signal_t signalType) throw (std::bad_alloc);
    TlvMessage* tlvMessage_;
    bool deleteTlvMessage_;

private:

    OamMessageProtocol_Signal();
    OamMessageProtocol_Signal(const OamMessageProtocol_Signal&);
    OamMessageProtocol_Signal& operator=(const OamMessageProtocol_Signal&);
};

class OamMessageProtocol_SysTime : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SysTime();
    OamMessageProtocol_SysTime(TlvMessage& message);
    virtual void pack(uint64_t tmValue);
    virtual bool unpack(uint64_t& tmValue);

private:
    OamMessageProtocol_SysTime(const OamMessageProtocol_SysTime&);
    OamMessageProtocol_SysTime& operator=(const OamMessageProtocol_SysTime&);
};

class OamMessageProtocol_SysTimeRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SysTimeRsp();
    OamMessageProtocol_SysTimeRsp(TlvMessage& message);
    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_SysTimeRsp(const OamMessageProtocol_SysTimeRsp&);
    OamMessageProtocol_SysTimeRsp& operator=(const OamMessageProtocol_SysTimeRsp&);
};

class OamMessageProtocol_TxPowerDbmStdGet : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerDbmStdGet();
    OamMessageProtocol_TxPowerDbmStdGet(TlvMessage& message);
    
private:
    OamMessageProtocol_TxPowerDbmStdGet(const OamMessageProtocol_TxPowerDbmStdGet&);
    OamMessageProtocol_TxPowerDbmStdGet& operator=(const OamMessageProtocol_TxPowerDbmStdGet&);
};

class OamMessageProtocol_TxPowerDbmStdGetRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerDbmStdGetRsp();
    OamMessageProtocol_TxPowerDbmStdGetRsp(TlvMessage& message);

    void pack(int8_t db);
    bool unpack(int8_t& db);
private:
    OamMessageProtocol_TxPowerDbmStdGetRsp(const OamMessageProtocol_TxPowerDbmStdGetRsp&);
    OamMessageProtocol_TxPowerDbmStdGetRsp& operator=(const OamMessageProtocol_TxPowerDbmStdGetRsp&);
};

class OamMessageProtocol_TxPowerDbmConfig : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerDbmConfig();
    OamMessageProtocol_TxPowerDbmConfig(TlvMessage& message);

    void pack(int8_t db);
    bool unpack(int8_t& db);
    
private:
    OamMessageProtocol_TxPowerDbmConfig(const OamMessageProtocol_TxPowerDbmConfig&);
    OamMessageProtocol_TxPowerDbmConfig& operator=(const OamMessageProtocol_TxPowerDbmConfig&);
};

class OamMessageProtocol_TxPowerDbmConfigRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerDbmConfigRsp();
    OamMessageProtocol_TxPowerDbmConfigRsp(TlvMessage& message);

    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);
private:
    OamMessageProtocol_TxPowerDbmConfigRsp(const OamMessageProtocol_TxPowerDbmConfigRsp&);
    OamMessageProtocol_TxPowerDbmConfigRsp& operator=(const OamMessageProtocol_TxPowerDbmConfigRsp&);
};


class OamMessageProtocol_TxPowerStdGet : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerStdGet();
    OamMessageProtocol_TxPowerStdGet(TlvMessage& message);
    
private:
    OamMessageProtocol_TxPowerStdGet(const OamMessageProtocol_TxPowerStdGet&);
    OamMessageProtocol_TxPowerStdGet& operator=(const OamMessageProtocol_TxPowerStdGet&);
};

class OamMessageProtocol_TxPowerStdGetRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerStdGetRsp();
    OamMessageProtocol_TxPowerStdGetRsp(TlvMessage& message);

    void pack(uint8_t txPwer);
    bool unpack(uint8_t& txPwer);
private:
    OamMessageProtocol_TxPowerStdGetRsp(const OamMessageProtocol_TxPowerStdGetRsp&);
    OamMessageProtocol_TxPowerStdGetRsp& operator=(const OamMessageProtocol_TxPowerStdGetRsp&);
};

class OamMessageProtocol_TxPowerStdCfg : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerStdCfg();
    OamMessageProtocol_TxPowerStdCfg(TlvMessage& message);
    
    void pack(uint8_t txPowerStd);
    bool unpack(uint8_t& txPowerStd);

private:
    OamMessageProtocol_TxPowerStdCfg(const OamMessageProtocol_TxPowerStdCfg&);
    OamMessageProtocol_TxPowerStdCfg& operator=(const OamMessageProtocol_TxPowerStdCfg&);
};

class OamMessageProtocol_TxPowerStdCfgRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerStdCfgRsp();
    OamMessageProtocol_TxPowerStdCfgRsp(TlvMessage& message);
    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_TxPowerStdCfgRsp(const OamMessageProtocol_TxPowerStdCfgRsp&);
    OamMessageProtocol_TxPowerStdCfgRsp& operator=(const OamMessageProtocol_TxPowerStdCfgRsp&);
};



class OamMessageProtocol_TxPower : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPower();
    OamMessageProtocol_TxPower(TlvMessage& message);
    virtual void pack(uint8_t* txpower, uint8_t* rxpower);
    virtual bool unpack(bool& isTxPresent, bool& isRxPresent, uint8_t& txpower, uint8_t& rxpower);

private:
    OamMessageProtocol_TxPower(const OamMessageProtocol_TxPower&);
    OamMessageProtocol_TxPower& operator=(const OamMessageProtocol_TxPower&);
};

class OamMessageProtocol_TxPowerRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_TxPowerRsp();
    OamMessageProtocol_TxPowerRsp(TlvMessage& message);
    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_TxPowerRsp(const OamMessageProtocol_TxPowerRsp&);
    OamMessageProtocol_TxPowerRsp& operator=(const OamMessageProtocol_TxPowerRsp&);
};

class OamMessageProtocol_VersionReq : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_VersionReq();
    OamMessageProtocol_VersionReq(TlvMessage& message);

private:
    OamMessageProtocol_VersionReq(const OamMessageProtocol_VersionReq&);
    OamMessageProtocol_VersionReq& operator=(const OamMessageProtocol_VersionReq&);
};

class OamMessageProtocol_VersionRpt : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_VersionRpt();
    OamMessageProtocol_VersionRpt(TlvMessage& message);
    virtual void pack(std::string& swVersion, std::string phyVer, std::string kernelVer, std::string hwVer);
    virtual bool unpack(std::string& swVersion, std::string& phyVer, std::string& kernelVer, std::string& hwVer);

private:
    OamMessageProtocol_VersionRpt(const OamMessageProtocol_VersionRpt&);
    OamMessageProtocol_VersionRpt& operator=(const OamMessageProtocol_VersionRpt&);
};

class OamMessageProtocol_SoftwareUpgradReq : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SoftwareUpgradReq();
    OamMessageProtocol_SoftwareUpgradReq(TlvMessage& message);

    bool pack(std::string& addr, uint8_t* md5ChckSum, uint32_t md5ChckSumLen);
    virtual bool unpack(std::string& addr, uint8_t* md5ChckSum, uint32_t& md5ChckSumLen);

    bool pack(std::string& ipAddr, std::string& fileName, uint8_t* md5ChckSum, uint32_t md5ChckSumLen, uint8_t downMode = 0);
    bool unpack(std::string& ipAddr, std::string& fileName, uint8_t*& md5ChckSum, uint32_t& md5ChckSumLen, uint8_t& downMode);

    //bool pack(std::string& ipAddr, std::string& fileName, uint8_t* md5ChckSum, uint32_t md5ChckSumLen, std::string& userName, std::string& passwd);
    //bool unpack(std::string& ipAddr, std::string& fileName, uint8_t*& md5ChckSum, uint32_t& md5ChckSumLen, std::string& userName, std::string& passwd);

private:
    OamMessageProtocol_SoftwareUpgradReq(const OamMessageProtocol_SoftwareUpgradReq&);
    OamMessageProtocol_SoftwareUpgradReq& operator=(const OamMessageProtocol_SoftwareUpgradReq&);
};

class OamMessageProtocol_SoftwareUpgradRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SoftwareUpgradRsp();
    OamMessageProtocol_SoftwareUpgradRsp(TlvMessage& message);
    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_SoftwareUpgradRsp(const OamMessageProtocol_SoftwareUpgradRsp&);
    OamMessageProtocol_SoftwareUpgradRsp& operator=(const OamMessageProtocol_SoftwareUpgradRsp&);
};

class OamMessageProtocol_SoftwareUpgradRpt : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SoftwareUpgradRpt();
    OamMessageProtocol_SoftwareUpgradRpt(TlvMessage& message);
    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_SoftwareUpgradRpt(const OamMessageProtocol_SoftwareUpgradRpt&);
    OamMessageProtocol_SoftwareUpgradRpt& operator=(const OamMessageProtocol_SoftwareUpgradRpt&);
};


class OamMessageProtocol_EquipReset : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_EquipReset();
    OamMessageProtocol_EquipReset(TlvMessage& message);

    virtual void pack(std::string& reason);
    virtual bool unpack(std::string& reason);
private:
    OamMessageProtocol_EquipReset(const OamMessageProtocol_EquipReset&);
    OamMessageProtocol_EquipReset& operator=(const OamMessageProtocol_EquipReset&);
};

class OamMessageProtocol_EquipResetRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_EquipResetRsp();
    OamMessageProtocol_EquipResetRsp(TlvMessage& message);
    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_EquipResetRsp(const OamMessageProtocol_EquipResetRsp&);
    OamMessageProtocol_EquipResetRsp& operator=(const OamMessageProtocol_EquipResetRsp&);
};

class OamMessageProtocol_EquipResetAccident : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_EquipResetAccident();
    OamMessageProtocol_EquipResetAccident(TlvMessage& message);

private:
    OamMessageProtocol_EquipResetAccident(const OamMessageProtocol_EquipResetAccident&);
    OamMessageProtocol_EquipResetAccident& operator=(const OamMessageProtocol_EquipResetAccident&);
};

class OamMessageProtocol_SysStatusReq : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SysStatusReq();
    OamMessageProtocol_SysStatusReq(TlvMessage& message);

private:
    OamMessageProtocol_SysStatusReq(const OamMessageProtocol_SysStatusReq&);
    OamMessageProtocol_SysStatusReq& operator=(const OamMessageProtocol_SysStatusReq&);
};

class OamMessageProtocol_SysStatusRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SysStatusRsp();
    OamMessageProtocol_SysStatusRsp(TlvMessage& message);
    void pack(uint32_t statusCode, const std::string& desc, uint8_t cpuTemp, uint8_t cpuUsage, uint8_t memUsage, int8_t boardTemp);
    bool unpack(uint32_t& statusCode, std::string& desc, uint8_t& cpuTemp, uint8_t& cpuUsage, uint8_t& memUsage, int8_t& boardTemp);

    bool unpack(uint32_t& statusCode);
private:
    OamMessageProtocol_SysStatusRsp(const OamMessageProtocol_SysStatusRsp&);
    OamMessageProtocol_SysStatusRsp& operator=(const OamMessageProtocol_SysStatusRsp&);
};

class OamMessageProtocol_EquipAssetsReq : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_EquipAssetsReq();
    OamMessageProtocol_EquipAssetsReq(TlvMessage& message);

private:
    OamMessageProtocol_EquipAssetsReq(const OamMessageProtocol_EquipAssetsReq&);
    OamMessageProtocol_EquipAssetsReq& operator=(const OamMessageProtocol_EquipAssetsReq&);
};

class OamMessageProtocol_EquipAssetsRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_EquipAssetsRsp();
    OamMessageProtocol_EquipAssetsRsp(TlvMessage& message);
    virtual void pack();
    virtual bool unpack();

private:
    OamMessageProtocol_EquipAssetsRsp(const OamMessageProtocol_EquipAssetsRsp&);
    OamMessageProtocol_EquipAssetsRsp& operator=(const OamMessageProtocol_EquipAssetsRsp&);
};

class OamMessageProtocol_SyncMode : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SyncMode();
    OamMessageProtocol_SyncMode(TlvMessage& message);

    virtual void pack(uint8_t mode);
    virtual bool unpack(uint8_t& mode);

private:
    OamMessageProtocol_SyncMode(const OamMessageProtocol_SyncMode&);
    OamMessageProtocol_SyncMode& operator=(const OamMessageProtocol_SyncMode&);
};

class OamMessageProtocol_SyncModeRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SyncModeRsp();
    OamMessageProtocol_SyncModeRsp(TlvMessage& message);
    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_SyncModeRsp(const OamMessageProtocol_SyncModeRsp&);
    OamMessageProtocol_SyncModeRsp& operator=(const OamMessageProtocol_SyncModeRsp&);
};

class OamMessageProtocol_SyncStatusReq : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SyncStatusReq();
    OamMessageProtocol_SyncStatusReq(TlvMessage& message);

private:
    OamMessageProtocol_SyncStatusReq(const OamMessageProtocol_SyncStatusReq&);
    OamMessageProtocol_SyncStatusReq& operator=(const OamMessageProtocol_SyncStatusReq&);
};

class OamMessageProtocol_SyncStatusRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SyncStatusRsp();
    OamMessageProtocol_SyncStatusRsp(TlvMessage& message);
    void pack(uint8_t statusType, uint8_t status);
    void pack(uint8_t statusType, uint8_t status, uint16_t arfcn, uint16_t pci, uint16_t rssi, uint16_t tac);
    bool unpack(uint8_t& statusType, uint8_t& status);
    bool unpack(uint8_t& statusType, uint8_t& status, uint16_t& arfcn, uint16_t& pci, uint16_t& rssi, uint16_t& tac);

private:
    OamMessageProtocol_SyncStatusRsp(const OamMessageProtocol_SyncStatusRsp&);
    OamMessageProtocol_SyncStatusRsp& operator=(const OamMessageProtocol_SyncStatusRsp&);
};

class OamMessageProtocol_GpsInfoReq : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_GpsInfoReq();
    OamMessageProtocol_GpsInfoReq(TlvMessage& message);

private:
    OamMessageProtocol_GpsInfoReq(const OamMessageProtocol_GpsInfoReq&);
    OamMessageProtocol_GpsInfoReq& operator=(const OamMessageProtocol_GpsInfoReq&);
};

class OamMessageProtocol_GpsInfoRpt : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_GpsInfoRpt();
    OamMessageProtocol_GpsInfoRpt(TlvMessage& message);
    virtual void pack(uint8_t statusCode, int32_t longitude, int32_t latitude);
    virtual bool unpack(uint8_t& statusCode, int32_t& longitude, int32_t& latitude);

private:
    OamMessageProtocol_GpsInfoRpt(const OamMessageProtocol_GpsInfoRpt&);
    OamMessageProtocol_GpsInfoRpt& operator=(const OamMessageProtocol_GpsInfoRpt&);
};

class OamMessageProtocol_PaSetting : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_PaSetting();
    OamMessageProtocol_PaSetting(TlvMessage& message);
    virtual void pack(uint8_t opCode, uint8_t* att = NULL);
    virtual bool unpack(uint8_t& opCode, bool& isAttPresent, uint8_t& att);

private:
    OamMessageProtocol_PaSetting(const OamMessageProtocol_PaSetting&);
    OamMessageProtocol_PaSetting& operator=(const OamMessageProtocol_PaSetting&);
};

class OamMessageProtocol_PaSettingRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_PaSettingRsp();
    OamMessageProtocol_PaSettingRsp(TlvMessage& message);
    virtual void pack(uint8_t statusCode);
    virtual bool unpack(uint8_t& statusCode);

private:
    OamMessageProtocol_PaSettingRsp(const OamMessageProtocol_PaSettingRsp&);
    OamMessageProtocol_PaSettingRsp& operator=(const OamMessageProtocol_PaSettingRsp&);
};

class OamMessageProtocol_PaStateReq : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_PaStateReq();
    OamMessageProtocol_PaStateReq(TlvMessage& message);
    virtual void pack(uint8_t target);
    virtual bool unpack(uint8_t& target);

private:
    OamMessageProtocol_PaStateReq(const OamMessageProtocol_PaStateReq&);
    OamMessageProtocol_PaStateReq& operator=(const OamMessageProtocol_PaStateReq&);
};

class OamMessageProtocol_PaStateReqRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_PaStateReqRsp();
    OamMessageProtocol_PaStateReqRsp(TlvMessage& message);
    virtual void pack(uint8_t target, uint8_t* tempreture, uint8_t* swr, uint8_t* att, uint8_t* pwoer);
    virtual bool unpack(uint8_t& target);
    bool unpackTemp(uint8_t& temp);
    bool unpackSwr(uint8_t& swr);
    bool unpackAttr(uint8_t& att);
    bool unpackPwer(uint8_t& pw);

private:
    OamMessageProtocol_PaStateReqRsp(const OamMessageProtocol_PaStateReqRsp&);
    OamMessageProtocol_PaStateReqRsp& operator=(const OamMessageProtocol_PaStateReqRsp&);
};

class OamMessageProtocol_AlarmReport : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_AlarmReport();
    OamMessageProtocol_AlarmReport(TlvMessage& message);
    virtual void pack(uint8_t alarmOp, uint32_t alarmCode);
    virtual bool unpack(uint8_t& alarmOp, uint32_t& alarmCode);

private:
    OamMessageProtocol_AlarmReport(const OamMessageProtocol_AlarmReport&);
    OamMessageProtocol_AlarmReport& operator=(const OamMessageProtocol_AlarmReport&);
};

class OamMessageProtocol_InitConfig : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_InitConfig();
    OamMessageProtocol_InitConfig(TlvMessage& message);

    virtual void packBandWidth(uint8_t bandWith);
    virtual bool unpackBandWidth(uint8_t& bandWith);

    void packSyncMode(uint8_t syncMode);
    bool unpackSyncMode(uint8_t& syncMode);
    
    void packTimeDelay(int32_t tmDelay);
    bool unpackTimeDelay(int32_t& tmDelay);

    void packIsSaveFS(bool isSave);
    bool unpackIsSaveFS(bool& isSave);

    void packWorkingBand(uint8_t band);
    bool unpackWorkingBand(uint8_t& band);

    void packWorkingMode(uint8_t wkMode);
    bool unpackWorkingMode(uint8_t& wkMode);
private:
    OamMessageProtocol_InitConfig(const OamMessageProtocol_InitConfig&);
    OamMessageProtocol_InitConfig& operator=(const OamMessageProtocol_InitConfig&);
};

class OamMessageProtocol_InitCfgComp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_InitCfgComp();
    OamMessageProtocol_InitCfgComp(TlvMessage& message);

    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_InitCfgComp(const OamMessageProtocol_InitCfgComp&);
    OamMessageProtocol_InitCfgComp& operator=(const OamMessageProtocol_InitCfgComp&);
};

class OamMessageProtocol_RxLevMinCfg : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_RxLevMinCfg();
    OamMessageProtocol_RxLevMinCfg(TlvMessage& message);

    virtual void pack(int16_t rxLevMin, uint8_t rxLevMinOff);
    virtual bool unpack(int16_t& rxLevMin, uint8_t& rxLevMinOff);

private:
    OamMessageProtocol_RxLevMinCfg(const OamMessageProtocol_RxLevMinCfg&);
    OamMessageProtocol_RxLevMinCfg& operator=(const OamMessageProtocol_RxLevMinCfg&);
};

class OamMessageProtocol_RxLevMinCfgRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_RxLevMinCfgRsp();
    OamMessageProtocol_RxLevMinCfgRsp(TlvMessage& message);

    virtual void pack(uint8_t rc);
    virtual bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_RxLevMinCfgRsp(const OamMessageProtocol_RxLevMinCfgRsp&);
    OamMessageProtocol_RxLevMinCfgRsp& operator=(const OamMessageProtocol_RxLevMinCfgRsp&);
};

class OamMessageProtocol_LocationModeSetting : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_LocationModeSetting();
    OamMessageProtocol_LocationModeSetting(TlvMessage& message);

    virtual void pack(bool isEnable, std::vector<std::string>* imsiList = NULL);
    virtual bool unpack(bool& isEnable, std::vector<std::string>& imsiList);

private:
    OamMessageProtocol_LocationModeSetting(const OamMessageProtocol_LocationModeSetting&);
    OamMessageProtocol_LocationModeSetting& operator=(const OamMessageProtocol_LocationModeSetting&);
};

class OamMessageProtocol_LocationModeSettingRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_LocationModeSettingRsp();
    OamMessageProtocol_LocationModeSettingRsp(TlvMessage& message);

    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_LocationModeSettingRsp(const OamMessageProtocol_LocationModeSettingRsp&);
    OamMessageProtocol_LocationModeSettingRsp& operator=(const OamMessageProtocol_LocationModeSettingRsp&);
};

class OamMessageProtocol_I2cTypeSetting : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_I2cTypeSetting();
    OamMessageProtocol_I2cTypeSetting(TlvMessage& message);

    void pack(uint8_t type);
    bool unpack(uint8_t& type);

private:
    OamMessageProtocol_I2cTypeSetting(const OamMessageProtocol_I2cTypeSetting&);
    OamMessageProtocol_I2cTypeSetting& operator=(const OamMessageProtocol_I2cTypeSetting&);
};

class OamMessageProtocol_I2cTypeSettingRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_I2cTypeSettingRsp();
    OamMessageProtocol_I2cTypeSettingRsp(TlvMessage& message);

    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_I2cTypeSettingRsp(const OamMessageProtocol_I2cTypeSettingRsp&);
    OamMessageProtocol_I2cTypeSettingRsp& operator=(const OamMessageProtocol_I2cTypeSettingRsp&);
};

class OamMessageProtocol_I2cInfoGet : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_I2cInfoGet();
    OamMessageProtocol_I2cInfoGet(TlvMessage& message);

    void pack(uint8_t addr, uint8_t len);
    bool unpack(uint8_t& addr, uint8_t& len);

private:
    OamMessageProtocol_I2cInfoGet(const OamMessageProtocol_I2cInfoGet&);
    OamMessageProtocol_I2cInfoGet& operator=(const OamMessageProtocol_I2cInfoGet&);
};

class OamMessageProtocol_I2cInfo : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_I2cInfo();
    OamMessageProtocol_I2cInfo(TlvMessage& message);

    void pack(std::string content);
    void pack(uint8_t rc);
    bool unpack(std::string& content);

private:
    OamMessageProtocol_I2cInfo(const OamMessageProtocol_I2cInfo&);
    OamMessageProtocol_I2cInfo& operator=(const OamMessageProtocol_I2cInfo&);
};

class OamMessageProtocol_I2cInfoWrite : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_I2cInfoWrite();
    OamMessageProtocol_I2cInfoWrite(TlvMessage& message);

    void pack(uint8_t addr, std::string content);
    bool unpack(uint8_t& addr, std::string& content);

private:
    OamMessageProtocol_I2cInfoWrite(const OamMessageProtocol_I2cInfoWrite&);
    OamMessageProtocol_I2cInfoWrite& operator=(const OamMessageProtocol_I2cInfoWrite&);
};

class OamMessageProtocol_I2cInfoWriteRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_I2cInfoWriteRsp();
    OamMessageProtocol_I2cInfoWriteRsp(TlvMessage& message);

    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_I2cInfoWriteRsp(const OamMessageProtocol_I2cInfoWriteRsp&);
    OamMessageProtocol_I2cInfoWriteRsp& operator=(const OamMessageProtocol_I2cInfoWriteRsp&);
};

class OamMessageProtocol_NmmDelayReport : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_NmmDelayReport();
    OamMessageProtocol_NmmDelayReport(TlvMessage& message);

    void pack(std::string imsi, uint16_t delay, uint32_t sinr, uint16_t rsrp, uint16_t ulArfcn);
    bool unpack(std::string& imsi, uint16_t& delay, uint32_t& sinr, uint16_t& rsrp, uint16_t& ulArfcn);

private:
    OamMessageProtocol_NmmDelayReport(const OamMessageProtocol_NmmDelayReport&);
    OamMessageProtocol_NmmDelayReport& operator=(const OamMessageProtocol_NmmDelayReport&);
};

class OamMessageProtocol_UeIdFilterSwitchCfg : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_UeIdFilterSwitchCfg();
    OamMessageProtocol_UeIdFilterSwitchCfg(TlvMessage& message);

    void pack(bool isEnable, uint32_t* timer = NULL);
    bool unpack(bool& isEnable, uint32_t& timer);

private:
    OamMessageProtocol_UeIdFilterSwitchCfg(const OamMessageProtocol_UeIdFilterSwitchCfg&);
    OamMessageProtocol_UeIdFilterSwitchCfg& operator=(const OamMessageProtocol_UeIdFilterSwitchCfg&);
};

class OamMessageProtocol_UeIdFilterSwitchCfgRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_UeIdFilterSwitchCfgRsp();
    OamMessageProtocol_UeIdFilterSwitchCfgRsp(TlvMessage& message);

    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_UeIdFilterSwitchCfgRsp(const OamMessageProtocol_UeIdFilterSwitchCfgRsp&);
    OamMessageProtocol_UeIdFilterSwitchCfgRsp& operator=(const OamMessageProtocol_UeIdFilterSwitchCfgRsp&);
};

class OamMessageProtocol_RunTimeParaCfg : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_RunTimeParaCfg();
    OamMessageProtocol_RunTimeParaCfg(TlvMessage& message);

    void packRanSharePara(bool isEnable);
    bool unpackRanSharePara(bool& isEnable);

    // type=0 : default cause
    // type=1:  unicom cause
    // type=2:  telecom cause
    // type=3:  mobile cause
    void packNasRejectCause(uint8_t type, uint8_t cause);
    bool unpackNasRejectCause(uint8_t& type, uint8_t& cause);

private:
    OamMessageProtocol_RunTimeParaCfg(const OamMessageProtocol_RunTimeParaCfg&);
    OamMessageProtocol_RunTimeParaCfg& operator=(const OamMessageProtocol_RunTimeParaCfg&);
};

class OamMessageProtocol_RunTimeParaCfgRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_RunTimeParaCfgRsp();
    OamMessageProtocol_RunTimeParaCfgRsp(TlvMessage& message);

    void pack(std::vector<uint8_t> failureParaTags);
    bool unpack(std::vector<uint8_t>& failureParaTags);

private:
    OamMessageProtocol_RunTimeParaCfgRsp(const OamMessageProtocol_RunTimeParaCfgRsp&);
    OamMessageProtocol_RunTimeParaCfgRsp& operator=(const OamMessageProtocol_RunTimeParaCfgRsp&);
};

class OamMessageProtocol_SetScanMode : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SetScanMode();
    OamMessageProtocol_SetScanMode(TlvMessage& message);

    void pack(std::vector<uint16_t>* dlArfcnList, uint32_t sec);
    bool unpack(std::vector<uint16_t>& dlArfcnList, uint32_t& sec);

private:
    OamMessageProtocol_SetScanMode(const OamMessageProtocol_SetScanMode&);
    OamMessageProtocol_SetScanMode& operator=(const OamMessageProtocol_SetScanMode&);
};

class OamMessageProtocol_SetScanModeRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_SetScanModeRsp();
    OamMessageProtocol_SetScanModeRsp(TlvMessage& message);

    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_SetScanModeRsp(const OamMessageProtocol_SetScanModeRsp&);
    OamMessageProtocol_SetScanModeRsp& operator=(const OamMessageProtocol_SetScanModeRsp&);
};
class OamMessageProtocol_InterferenceEnable : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_InterferenceEnable();
    OamMessageProtocol_InterferenceEnable(TlvMessage& message);

    void pack(bool isEnable);
    bool unpack(bool& isEnable);

private:
    OamMessageProtocol_InterferenceEnable(const OamMessageProtocol_InterferenceEnable&);
    OamMessageProtocol_InterferenceEnable& operator=(const OamMessageProtocol_InterferenceEnable&);
};
class OamMessageProtocol_UlArfcnCfg : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_UlArfcnCfg();
    OamMessageProtocol_UlArfcnCfg(TlvMessage& message);

    void pack(uint16_t arfcn);
    bool unpack(uint16_t& arfcn);

private:
    OamMessageProtocol_UlArfcnCfg(const OamMessageProtocol_UlArfcnCfg&);
    OamMessageProtocol_UlArfcnCfg& operator=(const OamMessageProtocol_UlArfcnCfg&);
};

class OamMessageProtocol_UlArfcnCfgRsp : public OamMessageProtocol_Signal
{
public:
    OamMessageProtocol_UlArfcnCfgRsp();
    OamMessageProtocol_UlArfcnCfgRsp(TlvMessage& message);

    void pack(uint8_t rc);
    bool unpack(uint8_t& rc);

private:
    OamMessageProtocol_UlArfcnCfgRsp(const OamMessageProtocol_UlArfcnCfgRsp&);
    OamMessageProtocol_UlArfcnCfgRsp& operator=(const OamMessageProtocol_UlArfcnCfgRsp&);
};
#endif

